package DAO;

import org.hibernate.Query;
import org.hibernate.Session;

import Model.description;

/**
 * 简介表操作
 * @author MacBook
 *
 */
public class descriptionDAO {
	//添加简介
	public static void save(Session session,description d){
		session.save(d);
	}
	//获取简介
	public static description getDescription(Session sesion,int bookid){
		String hql = "from description where id = ?";
		Query<?> query = sesion.createQuery(hql);
		query.setParameter("id", bookid);
		description d = (description) query.list().get(0);
		return d;
	}
	//更新操作
	public static void update(Session session,description d){
		session.update(d);
	}
}
